package leetcode.offer;

import java.util.Arrays;

/**
 * ClassName: Offer40_GetleastNumbers
 * Description: leetcode-剑指offer 40 最小的k个数
 * date: 2021-11-12 19:44
 *
 * @author liyifan
 */
public class Offer40_GetLeastNumbers {
    public int[] getLeastNumbers(int[] arr, int k) {
        Arrays.sort(arr);
        int[] res = new int[k];
        for (int i = 0;i < k;i++) {
            res[i] = arr[i];
        }
        return res;
    }
}
